package net.wang.concurrency.test.immutable;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * 不可变对象
 */
public class ImmutableExample1 {

    public static final Integer a = 1;
    public static final String b = "2";
    private static final Map<Integer, Integer> map = Maps.newHashMap();

    static {
        map.put(1, 2);
        map.put(3, 4);
        map.put(5, 6);
    }

    public static void main(String[] args) {
        //a = 2;
        //b = "1";
        //map = new HashMap<>();
        map.put(1, 3);
        System.out.println(map.get(1));
    }

    public void test(final int a) {
        //a = 2;
    }
}
